package com.imu.wys.dao;

import com.imu.wys.model.UserLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

@Repository
public class UserLogDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void insertUserLog(UserLog userLog){
        String sql = "insert into j1_userlog(userid,username,userip,useraction,action_time) values (?,?,?,?,?)";
        Object[] args = new Object[]{userLog.getUserid(),userLog.getUsername(),userLog.getUserIP(),userLog.getAction(),userLog.getAction_time()};
        jdbcTemplate.update(sql,args);
    }

}
